<template>
  <div id="app">
    <h2>测试生命周期钩子</h2>
    <!-- 点击取反 -->
    <button @click="isShow = !isShow">切换显示</button>
    <!-- v-if控制子组件 -->
    <SonCom v-if="isShow" />
  </div>
</template>

<script>
import SonCom from './components/SonCom.vue'
export default {
  data () {
    return {
      isShow: false
    }
  },
  components: {
    SonCom
  }
}
</script>

<style></style>
